how to retrieve array values in java